package com.job.liushuang.HomeWork0718;

import java.sql.SQLOutput;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author Liushuang
 * @version 1.0
 * @since 2022-07-18 18:54:44
 */
public class lotteryTicket {//封装
    private static int num;
    private Integer count=0;

    public lotteryTicket() {
    }

    public lotteryTicket(Integer num, Integer count) {
        this.num = num;
        this.count = count;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("小明购买的彩票个数号码：");
        num = Integer.parseInt(scanner.nextLine());
        String[] cc = scanner.nextLine().split(" ");
        int count=0;
        Set<String> set = new HashSet<>();
        for (String str : cc) {
            set.add(str);
        }
        int[] winningTheLottery = new int[7];
        for (int i = 0; i < num; i++) {
            for (int j = 0; j < 7; j++) {
                if (set.contains(scanner.next())) {
                    count++;
                }
            }
            if (count != 0) {
                winningTheLottery[7-count]++;
            }
        }
        for (int i = 0; i < 6; i++) {//中奖等级
            System.out.print(winningTheLottery[i] + " ");
        }
        System.out.println("小明中了"+winningTheLottery[6]+"等奖！");
        scanner.close();
    }
}
